package com.buba.springcloud.service.impl;

import com.buba.springcloud.dao.CouponMapper;
import com.buba.springcloud.entities.HfCoupon;
import com.buba.springcloud.entities.HfCouponReceiveRecord;
import com.buba.springcloud.entities.HfCouponUseRecord;
import com.buba.springcloud.service.CouponService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author taodeyu
 * @Date 2022/1/6 下午 2:39
 * @Version 1.0
 */
@Service
public class CouponServiceImpl implements CouponService {

    @Resource
    private CouponMapper couponMapper;

    @Override
    public List<HfCoupon> getAllCoupon() {
        return couponMapper.getAllCoupon();
    }

    @Override
    public List<HfCouponReceiveRecord> getAllReceiveRecordByCoupon(Integer id) {
        return couponMapper.getAllReceiveRecordByCoupon(id);
    }

    @Override
    public List<HfCouponUseRecord> getAllUseRecordByCoupon(Integer id) {
        return couponMapper.getAllUseRecordByCoupon(id);
    }

    @Override
    public Integer saveCoupon(HfCoupon hfCoupon) {
        return couponMapper.saveCoupon(hfCoupon);
    }

    @Override
    public Integer alterSwitch(HfCoupon hfCoupon) {
        return couponMapper.alterSwitch(hfCoupon);
    }

    @Override
    public Integer updateCoupon(HfCoupon hfCoupon) {
        return couponMapper.updateCoupon(hfCoupon);
    }
}
